<?php

namespace App\Services;

use App\Models\CourseSectionVideo;

class CourseSectionVideoService extends BaseService
{
    /**
     * 获取列表
     * @return
     */
    public function list($sort,$order,$course_id, $course_section_id, $name) {
        $query = CourseSectionVideo::query();
        if(!empty($name)){
            $query->where('name','like',"%$name%");
        }
        if(!empty($course_id)){
            $query->where('course_id',$course_id);
        }
        if(!empty($course_section_id)){
            $query->where('course_section_id',$course_section_id);
        }
        return $query->orderBy($sort,$order)->get();
    }
}
